using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_BCodeRuleMap : EntityTypeConfiguration<t_BCodeRule>
    {
        public t_BCodeRuleMap()
        {
            // Primary Key
            this.HasKey(t => t.FRuleId);

            // Properties
            this.Property(t => t.FRuleId)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FRuleName)
                .IsRequired()
                .HasMaxLength(80);

            this.Property(t => t.FRuleNumber)
                .IsRequired()
                .HasMaxLength(80);

            this.Property(t => t.FShopInNumber)
                .HasMaxLength(80);

            // Table & Column Mappings
            this.ToTable("t_BCodeRule");
            this.Property(t => t.FRuleId).HasColumnName("FRuleId");
            this.Property(t => t.FRuleName).HasColumnName("FRuleName");
            this.Property(t => t.FRuleNumber).HasColumnName("FRuleNumber");
            this.Property(t => t.FShopInNumber).HasColumnName("FShopInNumber");
        }
    }
}
